
public class Book 
{

	private String name;
	private String title;
	
	public Book(String name, String title)
	{
		this.name = name;
		this.title = title;
	}
	
	
	@Override
	public int hashCode() 
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) 
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Book other = (Book) obj;
		if (name == null) 
		{
			if (other.name != null)
				return false;
		} 
		else if (!name.equals(other.name))
			return false;
		if (title == null)
		{
			if (other.title != null)
				return false;
		}
		else if (!title.equals(other.title))
			return false;
		return true;
	}


	public String getAuthor() { return name; }
	
	public String getTitle() { return title; }
	
	@Override
	public String toString() {
		return "Author: " + getAuthor() + " Title: " + getTitle();
	}
}